<?php
// Location: system/core/classes/uri.class.php

class uri {
  // Variables
  public $variables;
  
  // Functions
  function uri() {
    if (isset($_SERVER['PATH_INFO'])) {
      $this->variables['server']['path_info'] = $_SERVER['PATH_INFO'];
      $this->variables['uri'] = explode('/', $this->variables['server']['path_info']);
    }
    if (__isset($this->variables['uri'])) {
      foreach ($this->variables['uri'] as $key => $value) {
        switch ($key) {
          case 0:
            continue;
          break;
          case 1:
            $this->variables['command'] = $value;
          break;
          default:
            $this->variables['subcommand'][$key-2] = $value;
          break;
        }
      }
    }
  }
  function get() {
    if (__isset($_SERVER['PATH_INFO'])) {
      return $this->variables['uri'];
    }
    else {
      return false;
    }
  }
}
$system['classes']['uri'] = new uri();

?>
